<template>
  <div class="flex-row">
    <creat-and-revise :sql-url="sqlUrl" :data="model" @refresh-child="refreshChild" @refresh-child-condition="refreshChildCondition" v-ref:creat></creat-and-revise>
    <hand-manager :start-date='model.startDate' :end-date='model.endDate'
                  @change-inputtor="search" @refresh="refresh()" v-ref:hand></hand-manager>
  </div>
</template>

<script>
  import CreatAndRevise from '../CreatAndRevise'
  import HandManager from './HandManager'
  import * as Util from '../../../Util'

  export default {
    title: '机表抄表',
    components: {CreatAndRevise, HandManager},
    data () {
      return {
        sqlUrl: 'rs/sql/periodInputor',
        model: {
          startDate: Util.toStartAndEndDateString()[0],
          endDate: Util.toStartAndEndDateString()[1]
        }
      }
    },
    methods: {
      refresh () {
        this.search()
        this.refreshChild()
      },
      search () {
        this.$refs.creat.search()
      },
      refreshChild () {
        this.$refs.hand.reflash()
      },
      refreshChildCondition (inputtor, state, num) {
        this.$refs.hand.searchGather(inputtor, state, num)
      }
    }
  }
</script>

<style scoped>

</style>
